package com.mvc.base.web;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.extremecomponents.table.limit.Limit;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.mvc.base.model.Company;
import com.mvc.base.service.CompanyManager;
import com.mvc.framework.service.PageManager;
import com.mvc.framework.util.PageSearch;
import com.mvc.framework.util.PageUtils;

/** 
 * 
 * @author  snowpbx
 * @version V1.0  Create Time: 2012-10-5
 */
@Controller
@RequestMapping("company")
public class CompanyController extends BaseGroupController<Company> {
	@Autowired
	private CompanyManager companyManager;
	@Override
	public PageManager<Company> getEntityManager() {
		return companyManager;
	}

	@Override
	public String getFileBasePath() {
		return "base/";
	}

	public String my(HttpServletRequest request, HttpServletResponse response) throws Exception {
		Limit limit = PageUtils.getLimit(request);
		PageSearch page = preparePage(request, limit);
		String result = handlePage(request, page);
		afterPage(request, page, IS_NOT_BACK);
		request.setAttribute("action", "my");
		return result;
	}

}


